home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_rename_file.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  979 b   |  48 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_RENAME_FILE
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    core1: STRING is "core1.tmp";
  12.  
  13.    core2: STRING is "core2.tmp";
  14.  
  15.    make is
  16.       local
  17.      std_fw: STD_FILE_WRITE;
  18.       do
  19.      if file_exists(core1) then
  20.         remove_file(core1);
  21.      end;
  22.      is_true(not file_exists(core1));
  23.      !!std_fw.connect_to(core1);
  24.      std_fw.disconnect;
  25.      is_true(file_exists(core1));
  26.      rename_file(core1,core2);
  27.      is_true(file_exists(core2));
  28.      is_true(not file_exists(core1));
  29.      remove_file(core2);
  30.      is_true(not file_exists(core2));
  31.       end;
  32.    
  33.    is_true(b: BOOLEAN) is
  34.       do
  35.      cpt := cpt + 1;
  36.      if not b then
  37.         std_output.put_string("TEST_RENAME_FILE: ERROR Test # ");
  38.         std_output.put_integer(cpt);
  39.         std_output.put_string("%N");
  40.      else
  41.         -- std_output.put_string("Yes%N");
  42.      end;
  43.       end;
  44.    
  45.    cpt: INTEGER;
  46.    
  47. end -- TEST_RENAME_FILE
  48.